﻿@using SCMS.Resources
@model SCMS.UI.Models.FleetManager
@{AjaxOptions ajaxOpts = new AjaxOptions
  {
      UpdateTargetId = "fleetDiv",
      LoadingElementId = "loading",
      HttpMethod = "Post",
      Url = Url.Action(ViewBag.Action),
      OnSuccess = string.Format("usermsg('{0}');CloseDialog(); initPostFundsView(0);", Resources_frank.Global_String_ProcessCompleted),
      OnFailure = "javascript:errormsg()"
  };}
<script src="@Url.Content("~/Scripts/js/jquery-1.7.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/jquery.autocomplete.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form", @id = "frmFD" }))
{
    @Html.ValidationSummary(true)
    <br />
    @Html.HiddenFor(model => model.EntityFleetDetails.Id)
    @Html.HiddenFor(model => model.EntityFleetDetails.CountryProgrammeId)
    @Html.HiddenFor(model => model.EntityFleetDetails.IssueDate)
    <table width="98%" align="center" cellpadding="0">
        <tr class="gridheader2">
            <td align="center" width="33.3%">
                @Resources_frank.Global_String_AssetName
            </td>
            <td align="center" width="33.3%">
                @Resources_frank.Global_String_Brand
            </td>
            <td align="center" width="33.3%">
                @Resources_frank.Global_String_Model
            </td>
        </tr>
        <tr>
            <td align="center" valign="top" id="assetIds">
                @*<input type="text" name="AssetDescc" id="AssetDescc" onchange = "javascript:GetFilteredAssets()" />
                <script type="text/javascript">
                    var $jq = jQuery.noConflict();
                    $jq("#AssetDescc").autocomplete("/GoodsReceivedNote/SearchAssetDesc");
                </script>*@
                @Html.DropDownListFor(x => x.EntityFleetDetails.AssetId, Model.Assets, Resources_frank.Global_String_PleaseSelect)
                @Html.ValidationMessageFor(x => x.EntityFleetDetails.AssetId, Resources_frank.Global_String_Required)
            </td>
            <td align="center" valign="top">
                @Html.DropDownList("BrandID", Model.Brands, Resources_frank.Global_String_PleaseSelect, new { onchange = "javascript:GetItemModels(this)" })
            </td>
            <td align="center" valign="top" id="ModelDiv">
                @Html.DropDownListFor(x => x.EntityFleetDetails.ModelId, Model.Modelz, Resources_frank.Global_String_PleaseSelect)
                @Html.ValidationMessageFor(x => x.EntityFleetDetails.ModelId, Resources_frank.Global_String_Required)
            </td>
        </tr>
        <tr class="gridheader2">
            <td align="center" width="33.3%">
                @Resources_frank.FleetManager_LoadNewFleetDetail_ModelYear
            </td>
            <td align="center" width="33.3%">
                @Resources_frank.FleetManager_LoadNewFleetDetail_PlateNo
            </td>
            <td align="center" width="33.3%">
                @Resources_frank.FleetManager_LoadNewFleetDetail_EngineNo
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                @Html.TextBoxFor(x => x.EntityFleetDetails.ModelYear)
                @Html.ValidationMessageFor(x => x.EntityFleetDetails.ModelYear, Resources_frank.Global_String_Required)
            </td>
            <td align="center" valign="top">
                @Html.TextBoxFor(x => x.EntityFleetDetails.PlateNo)
                @Html.ValidationMessageFor(x => x.EntityFleetDetails.PlateNo, Resources_frank.Global_String_Required)
            </td>
            <td align="center">
                @Html.TextBoxFor(x => x.EntityFleetDetails.EngineNo)
                @Html.ValidationMessageFor(x => x.EntityFleetDetails.EngineNo, Resources_frank.Global_String_Required)
            </td>
        </tr>
        <tr class="gridheader2">
            <td align="center" width="33.3%">
                @Resources_frank.FleetManager_LoadNewFleetDetail_ChassisNo
            </td>
            <td align="center" width="33.3%">
                @Resources_frank.FleetManager_LoadNewFleetDetail_InitialMileage
            </td>
            <td align="center" width="33.3%">
                @Resources_frank.FleetManager_LoadNewFleetDetail_FleetType
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                @Html.EditorFor(x => x.EntityFleetDetails.ChassisNo)
                @Html.ValidationMessageFor(x => x.EntityFleetDetails.ChassisNo, Resources_frank.Global_String_Required)
            </td>
            <td align="center" valign="top">
                @Html.TextBoxFor(x => x.EntityFleetDetails.InitialMilleage)
                @Html.ValidationMessageFor(x => x.EntityFleetDetails.InitialMilleage, Resources_frank.Global_String_Required)
            </td>
            <td align="center" valign="top">
                @Html.DropDownListFor(x => x.EntityFleetDetails.FleetType, new SelectList(
                        new List<Object>{ 
                            new { value = "Motor" , text = Resources_frank.Global_String_Motor  },
                            new { value = "Generator" , text = Resources_frank.Global_String_Generator }
                        }, "value", "text"), Resources_frank.Global_String_PleaseSelect)
                @Html.ValidationMessageFor(x => x.EntityFleetDetails.FleetType, Resources_frank.Global_String_Required)
            </td>
        </tr>
        <tr class="gridheader2">
            <td align="center" width="33.3%">
                @Resources_frank.FleetManager_LoadNewFleetDetail_DutyType
            </td>
            <td align="center" width="33.3%">
                @Resources_frank.FleetManager_LoadNewFleetDetail_InsuranceType
            </td>
            <td align="center" width="33.3%">
                @Resources_frank.FleetManager_LoadNewFleetDetail_InsuranceExpiryDate
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                @Html.DropDownListFor(x => x.EntityFleetDetails.DutyTypeId, Model.DutyTypes, Resources_frank.Global_String_PleaseSelect)
                @Html.ValidationMessageFor(x => x.EntityFleetDetails.DutyTypeId, Resources_frank.Global_String_Required)
            </td>
            <td align="center" valign="top">
                @Html.DropDownListFor(x => x.EntityFleetDetails.InsuranceTypeId, Model.InsuranceTypes, Resources_frank.Global_String_PleaseSelect)
                @Html.ValidationMessageFor(x => x.EntityFleetDetails.InsuranceTypeId, Resources_frank.Global_String_Required)
            </td>
            <td align="center" valign="top">
                @Html.EditorFor(x => x.EntityFleetDetails.InsuranceExpiryDate)
                @Html.ValidationMessageFor(x => x.EntityFleetDetails.InsuranceExpiryDate, Resources_frank.Global_String_Required)
            </td>
        </tr>
        <tr class="gridheader2">
            <td align="center" width="33.3%">
                @Resources_frank.FleetManager_LoadNewFleetDetail_FuelType
            </td>
            <td align="center" width="33.3%">
            </td>
            <td align="center" width="33.3%">
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                @Html.DropDownListFor(x => x.EntityFleetDetails.FuelType, new SelectList(
                        new List<Object>{ 
                            new { value = "Petrol" , text = Resources_frank.Global_String_Petrol  },
                            new { value = "Diesel" , text = Resources_frank.Global_String_Diesel }
                        }, "value", "text"), Resources_frank.Global_String_PleaseSelect)
                @Html.ValidationMessageFor(x => x.EntityFleetDetails.FuelType, Resources_frank.Global_String_Required)
            </td>
            <td align="center" valign="top">
            </td>
            <td align="center" valign="top">
            </td>
        </tr>
    </table>
    <hr />
               
    <center>
        <input type="submit" class="btn green" value="  @Resources_frank.Global_String_Save  " /></center>
}
